Software Development
Defensive C++
Defensive C++: Defensive Programming & Defensive Design
Defensive C++: Design by Contract & Features in C++
Defensive C++: Managing Memory
Defensive C++: Software Engineering Principles & Types of Errors
Defensive C++: Writing Defensive C++ Code

Defensive C++: Defensive Programming & Defensive Design

Course Number:
it_sddefc_02_enus
Lesson Objectives

Defensive C++: Defensive Programming & Defensive Design

  • discover the key concepts covered in this course
  • choose the right defensive programming technique for the different use cases
  • recall the important principles of defensive design
  • choose the correct error reporting technique to handle and flag errors
  • use compiler warnings to identify uninitialized variables
  • use compiler warnings to identify implicit conversions and assignment operator to identify conditional checks
  • use return values to report errors
  • use exceptions for error handling
  • configure multiple catch blocks correctly to catch exceptions
  • program defensively using preconditions for input checks
  • program defensively using postconditions for method guarantees
  • summarize the key concepts covered in this course

Overview/Description
While defensive design involves planning for contingencies that might occur in a software development life cycle, defensive programming entails writing code such that it continues to function predictably in the presence of unforeseen circumstances. Through this course, explore the role of defensive programming and defensive design and the implementation of a defensive barrier in your code. You'll investigate various error reporting techniques, recognize scenarios for implementing a technique rather than exceptions, and distinguish between using exceptions and assertions to raise errors. The course will also help you discover how to use preconditions to check for inputs to your code and postconditions to verify the final results returned by your code. At the end of this course, you will have the skills and ability to follow a defensive approach to your software development and use exceptions and assertions to flag preconditions and check for postconditions.

Target

Prerequisites: none

Defensive C++: Design by Contract & Features in C++

Course Number:
it_sddefc_05_enus
Lesson Objectives

Defensive C++: Design by Contract & Features in C++

  • discover the key concepts covered in this course
  • outline the components of design by contract and the technical specifications of C++ 23's design by contract implementation
  • list the features of modern C++ and the important features of every recent C++ release, including C++ 20
  • list the functions available in the ranges library released in C++20
  • make the right choice between defensive programming and offensive programming techniques
  • summarize the key concepts covered in this course

Overview/Description
Design by contract (DbC) involves two parties, a client and a supplier, collaborating based on mutual obligations and benefits. DbC was intended to be released as a part of the C++ language in C++20, but will now be part of the C++23 release. Use this course to examine the technical specifications of design by contract and the role of its key components - preconditions, invariants, and postconditions. You'll explore the most important features released in C++20, including the ranges library, coroutines, concepts, and modules. You'll also discover the weaknesses in defensive programming and when to implement offensive programming techniques in your code. When you are finished with this course, you will be able to tackle complex projects built using C++ and write code for them using software engineering principles and defensive programming techniques.

Target

Prerequisites: none

Defensive C++: Managing Memory

Course Number:
it_sddefc_04_enus
Lesson Objectives

Defensive C++: Managing Memory

  • discover the key concepts covered in this course
  • outline the resource allocation is initialization design principle in C++
  • identify the issues with manual memory management on the free store
  • recognize how to write, copy, and move constructors and assignment operators for your classes
  • use smart pointers for automated memory management
  • summarize the key concepts covered in this course

Overview/Description
Modern C++ offers the use of smart pointers in the C++ standard library, which uses the resource allocation is initialization (RAII) technique to free programmers from the burden of resource management. Take this course to discover the various pitfalls involved in manually managing memory on the free store in C++. Through this course, you'll explore how to automate the management of resources that need to be explicitly acquired and reduce resource management issues through the RAII technique. When you are finished with this course, you should be able to manage memory and other resources in your C++ code using smart pointers from the standard library.

Target

Prerequisites: none

Defensive C++: Software Engineering Principles & Types of Errors

Course Number:
it_sddefc_01_enus
Lesson Objectives

Defensive C++: Software Engineering Principles & Types of Errors

  • discover the key concepts covered in this course
  • recall the important software engineering principles to write robust, maintainable code
  • recall software engineering design practices, such as design by contract, code readability, and comprehension
  • identify the role of the preprocessor, compiler, and linker in building a C++ executable
  • list the types of errors encountered while writing and running code
  • set up the development environment to write C++ code
  • execute a basic C++ program to test the environment
  • write readable and comprehensible code
  • identify code that violates software engineering principles
  • fix violations of software engineering principles in a code
  • outline how to debug and fix compiler errors
  • recognize how to debug and fix linker, runtime, and logic errors
  • summarize the key concepts covered in this course

Overview/Description
Using high-quality code in any programming language involves writing code that is clear, comprehensible, and maintainable. This means that your code needs to follow sound software engineering principles, and it is also important to know and deal with the different kinds of errors that might occur in code. Use this course to explore key principles of software engineering and learn how the preprocessor, compiler, and linker come together to build your C++ executable. You will also examine different kinds of errors in code, including compiler, linker, runtime, and logic errors. When you are finished with this course, you will have the skills and ability to implement software engineering principles to write clean and comprehensible code.

Target

Prerequisites: none

Defensive C++: Writing Defensive C++ Code

Course Number:
it_sddefc_03_enus
Lesson Objectives

Defensive C++: Writing Defensive C++ Code

  • discover the key concepts covered in this course
  • write C++ code incorporating defensive techniques
  • specify constructors that leave your object in a valid state
  • use the const keyword early and often to identify methods that don't update member variables
  • override virtual functions to take advantage of runtime polymorphism
  • identify situations where object slicing is likely to occur
  • use the right type of cast for your use case
  • use the right type of cast when you need additional checks
  • manage memory correctly even when exceptions occur in code
  • write code to avoid the static initialization order fiasco
  • use the right technique to access elements of a collection
  • summarize the key concepts covered in this course

Overview/Description
Writing good, robust, and maintainable C++ code involves understanding the intricacies of the language and avoiding common pitfalls. Use this course to learn more about avoiding fatal coding errors, adopting defensive coding techniques, and following best practices and other code niceties Examine some common coding errors, the correct way to set up constructors in code, and the pitfalls of overriding non-virtual functions. You will also explore object slicing errors, how to cast objects to other types, and the use of smart pointers to manage resources in C++. Finally, you will understand the implications of the static initialization order fiasco in C++ and how you can avoid it. At the end of this course, you will have the knowledge and skills to write robust, defensive C++ code.

Target

Prerequisites: none

Close Chat Live